import http from "../common/request"

export default {
  onPageLoad(query) {
    //console.log('---------> LifeCycle onPageLoad', query)
  },
  onPageShow() {
    // console.log('---------> LifeCycle onPageShow')
    let formDataTemp = app.getStorageSync('formDataTemp')

    //提交人脸核验信息至后端
    if (formDataTemp) {
        const token = app.getStorageSync('token')
        const header = token ? { token } : {}
        const data = {
          idCardNumber: formDataTemp['10'].id_card_number,
          name: formDataTemp['10'].name
        }

        http.request({
            url: `${app.state.tempRequestUrl}wx/auth/faceCheckUpdateUser`,
            header,
            method: 'POST',
            data,
        }).then(res => {
            console.log('res', res)
        })
    }
  },
  onPageReady() {
    //console.log('---------> LifeCycle onPageReady')
  },
  onPageHide() {
    //console.log('---------> LifeCycle onPageHide')
  },
  onPageUnload() {
    //console.log('---------> LifeCycle onPageUnload')
  },
}